--- title: Calibration Procedure keywords: fastai sidebar: home_sidebar summary: "Every OpenHSI camera is unique and requires calibration before use. This module provides the abstractions to create the calibration data which are then used in operation. " description: "Every OpenHSI camera is unique and requires calibration before use. This module provides the abstractions to create the calibration data which are then used in operation. " nb_path: "nbs/05_calibrate.ipynb" ---
There are a few ways to create a SettingsBuilder class that words for your custom camera. (They involve Python metaclasses and mixins)
For example, you can then create a SettingsBuilder class that works for your custom camera by doing one of the following. {% include note.html content='Below we use the ’SimulatedCamera’ class, when calibrating a real camera you would use the camera class that inherits the ’SimulatedCamera’ class.' %}
SettingsBuilder = create_settings_builder("SettingsBuilder",SimulatedCamera)
sb = SettingsBuilder(json_path="assets/cam_settings.json",
pkl_path="assets/cam_calibration.pkl")
class CalibrateOpenHSI(SettingsBuilderMixin, SimulatedCamera):
pass
sb = CalibrateOpenHSI(json_path="assets/cam_settings.json",
pkl_path="assets/cam_calibration.pkl")
hvimg=sb.retake_flat_field(show=True)
hvimg.opts(width=400,height=400)
print(sb.calibration["flat_field_pic"].max())
hvimg
sb.update_row_minmax()
sb.update_resolution()
hvimg=sb.retake_HgAr(show=True, nframes=1)
hvimg.opts(width=400,height=400)
print(sb.calibration["HgAr_pic"].max())
hvimg